# -*- coding: utf-8 -*-


"""
外观模式

模式特点：为一组调用提供一致的接口。

程序实例：接口将几种调用分别组合成为两组，用户通过接口调用其中的一组。

代码特点：无
"""


class SubSystemOne(object):

    def method_one(self):
        print "SubSystemOne"


class SubSystemTwo(object):

    def method_two(self):
        print "SubSystemTwo"


class SubSystemThree(object):

    def method_three(self):
        print "SubSystemThree"


class SubSystemFour(object):

    def method_four(self):
        print "SubSystemFour"


class Facade(object):

    def __init__(self):
        self.one = SubSystemOne()
        self.two = SubSystemTwo()
        self.three = SubSystemThree()
        self.four = SubSystemFour()

    def method_a(self):
        print "MethodA"
        self.one.method_one()
        self.two.method_two()
        self.four.method_four()

    def method_b(self):
        print "MethodB"
        self.two.method_two()
        self.three.method_three()


if __name__ == "__main__":

    facade = Facade()
    facade.method_a()
    facade.method_b()

